import concurrent.futures

def initializer():
    print("Initializer called")

def worker(n):
    print(f"Worker called {n}")

# with concurrent.futures.ThreadPoolExecutor(initializer=initializer) as executor:
#     executor.submit(worker)

with concurrent.futures.ThreadPoolExecutor(max_workers=5,initializer=initializer) as executor:

    threads = [executor.submit(worker,i) for i in range(10)]

    # for i in range(10):
    #     t = executor.submit(worker)
    #     threads.append(t)


    # executor.submit(worker)